01 backpack, full backpack, multiple backpack, and mixed backpack Problems
P01: 01 backpack Problems
Question
There are n items and a backpack with a capacity of v. The cost of the I-th item is C [I], and the value is W [I]. Solving which items are
P01: 01 backpack ProblemsQuestionThere are n items and a backpack with a capacity of v. The cost of the I-th item is C [I], and the value is W [I]. Solving which items are loaded into a backpack can maximize the total value.
Basic IdeasThis is the
Backpack 01 Backpack, full backpack, multi-backpack detailed
PS: We feel that the writing is passable, help me to the top of the blog, thank you.
First of all, dynamic planning, dynamic planning this thing and recursion, can only find local
One, what is 01 backpack
01 The backpack is a few pieces of m items in the space W backpack, each item volume of W1,W2 to WN, corresponding to the value of P1,P2 to PN. 01 Backpack is the simplest problem in knapsack problem. 01 Backpack
I recently read about the 9-story backpack. We need to carefully study this kind of White Paper. Because there are some thinking jumps in it, we need to add our own understanding on the basis of the original article.
Question
There are n items and a
Elementary Introduction to 01 fractional planningThe so-called 01 score plan, see this name, may think of 01 backpack, actually grow similar.This algorithm is required to "cost-effective" the highest solution. Sum (v)/sum (W) the highest solution.
First of all, dynamic planning, dynamic planning this thing and recursion, can only find local relations, if you want to all listed, it is difficult, such as Hanoi. You can say that all the other layers except the last layer are moved to 2, and then
One, 01 backpackThere are n items and a backpack with a capacity of V. The price of item I (i.e. volume, hereinafter) is w[i], the value is c[i]. The solution of which items are loaded into the backpack allows the sum of the costs of these items to
Explanation of backpack 01, full, and multiple
PS: If you think you can write well, just help me pin my blog. Thank you.
First, let's talk about dynamic planning. Dynamic Planning is just like recursion. We can only find local relationships.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.